%{
#include "parser.tab.hpp"
#include <stdio.h>
%}

%option noyywrap
%option yylineno
WHILE while
ELSE else
IF if
VOID void
MAIN main
TYPE "int"|"boolean"
PAR_OP \(
PAR_CL \)
BR_OP \{
BR_CL \}
SEMICOL	\;
COMMA \,
ASSIGN \=
NEG !
CMP ==|<=|<|>=|>|!=
W [ \t\r\n\f\r\n]+
C \/\/.*[\r\n(\r\n)]
ID [a-zA-Z][a-zA-Z0-9]*
ADDOP  \+
SUBOP  \-
PRODOP \*
DIVOP  \/
AND &&
OR	\|\|
LIT true|false|[0-9]+

%%
{WHILE}		{yylval.str = yytext;return WHILE;}
{ELSE}		{yylval.str = yytext; return ELSE;}
{IF}		{yylval.str = yytext; return IF;}
{VOID}		{return VOID;}
{MAIN}		{return MAIN;}
{TYPE}		{yylval.str = yytext; return TYPE;}
{PAR_OP}	{ return PAR_OP;}
{PAR_CL}	{ return PAR_CL;}
{BR_OP}		{ return BR_OP;}
{BR_CL}		{ return BR_CL;}
{SEMICOL}	{ return SEMICOL;}
{COMMA}		{return COMMA;}
{ASSIGN}	{ return ASSIGN;}
{NEG}		{return NEG;}
{CMP}		{yylval.str = yytext;return CMP;}
{AND}		{return AND;}
{OR}		{return OR;}
{ADDOP}		{return ADDOP;}
{PRODOP}	{ return PRODOP;}
{SUBOP}		{ return SUBOP;}
{DIVOP}		{ return DIVOP;}
{W}
{C}
{ID} {yylval.str = yytext; return ID;}
{LIT} {yylval.str = yytext; return LIT;}
